Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIG-1514: An invalid chart in CustomOfflineCharts.js causes the searchpage to whitescreen. #202

Merged
merged 6 commits into from
Jan 14, 2025

Conversation

OrdiNeu
Copy link
Contributor

@OrdiNeu OrdiNeu commented Dec 31, 2024

Ticket(s)

Description

  • This fixes an issue where an erroneous localstorage would cause the searchpage to whitescreen. This also involves a refactor of the entire dataVisualization.js component, as it was a bit unwieldy to work with.

Expected Behaviour

  • No changes should be visible, although if you corrupt your localStorage into having an invalid chart type it should fix itself automatically.

Types of Change(s)

  • 🪲 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)

Has it been tested for:

  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • Prettier linter doesn't return errors
  • Production branch PR browser testing: Chrome, Firefox, Edge, etc.
  • Locally tested
  • Dev server tested
  • Production tested when merging into stable/production branch
  • Runbook tasks pass locally/on UHN-Dev
  • If visuals have changed, Runbook has been updated with new screenshots

…ype in localstorage would cause a whitescreen
Copy link
Member

@CourtneyGosselin CourtneyGosselin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am encountering several errors with the data visualization component:

  1. Changing chartType in local storage:
  • I tried setting one to bars instead of bar this resulted in highcharts error number 17 missingModuleFor=bars
  • Tried changing the data to a non-existent option and got an infinite loading time
  1. Changing dropdowns
  • Changing the dropdown of the data or chartType resulted in an error as well.

image

Most of these resolve after page refresh.

@OrdiNeu
Copy link
Contributor Author

OrdiNeu commented Jan 10, 2025

I am encountering several errors with the data visualization component:

1. Changing chartType in local storage:


* I tried setting one to `bars` instead of `bar` this resulted in highcharts error number 17 `missingModuleFor=bars`

* Tried changing the data to a non-existent option and got an infinite loading time


2. Changing dropdowns


* Changing the dropdown of the data or chartType resulted in an error as well.

image

Most of these resolve after page refresh.

Should be fixed now, though after staring at my code I have no idea how it ever worked in the first place. Thanks!

Copy link
Member

@CourtneyGosselin CourtneyGosselin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you remove a chart, it only removes the last chart added instead of the specific one. Code now works correctly when using the dropdowns. Additionally, it works if I change the localStorage chartType to an invalid option. However, if you set it to an invalid data option, the chart enters an infinite loading state. We might want to prevent this from displaying as well. Also two linter warnings are shown

@OrdiNeu
Copy link
Contributor Author

OrdiNeu commented Jan 13, 2025

@CourtneyGosselin
Should be fixed now

Copy link
Member

@CourtneyGosselin CourtneyGosselin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@OrdiNeu OrdiNeu merged commit 74dc4f5 into develop Jan 14, 2025
3 checks passed
@OrdiNeu OrdiNeu deleted the bugfix/invalid-offline-chart branch January 14, 2025 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants